#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{

	int N = 0;
	int K = 0;
	int S = 0;
	scanf("%d %d %d", &N, &K, &S);  

	int count = 0;
	int list[20][2] = { 0 };
	while (N--)
	{
		scanf("%d %d", &list[count][0], &list[count][1]);
		count++;
	}


	//10 2 90
	//203 0
	//169 91
	//175 88
	//175 0
	//175 90
	//189 0
	//189 0
	//189 95
	//189 89
	//256 100
	int num = 0;
	while (K--)
	{
		int pre = 0;
		for (int i = 0; i < count; i++)
		{
			
			if (list[i][0] >= 175)
			{
				if (list[i][0] == pre)
				{
					if (list[i][1] >= S)
					{
						num++;
						pre = list[i][0];
						list[i][0] = 0;
						list[i][1] = 0;
					}
				}
				else
				{
					num++;
					pre = list[i][0];
					list[i][0] = 0;
					list[i][1] = 0;
				}				
			}
		}
	}

	printf("%d", num);

	return 0;
}
